package lesson3.models;

import components.DirectionalTranslator;
import java2d.game.Time;

/**
 * Author:     Zhao Yan
 * DateTime:   2023/4/18 18:36
 */
public class Enemy extends Spacecraft {

    public final DirectionalTranslator translator = new DirectionalTranslator();


    public Enemy() {
        super("assets/sprites/observer.png");
        name = "Enemy";
        tag = "Enemy";
        targetTag = "Player";
        addComponent(translator);

        shootDirection.setLocation(0, 1.0);

        translator.speed = 0.1;
        translator.rotationDelta = -90;
        translator.direction.setLocation(0, 1);

        hpBar.transform.setLocalPosition(0, -40);

//        collider.visible = false;
        collider.radius = 20;
        collider.offset.setLocation(0, -15);

        translator.begin();
    }
}
